﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Others_Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        //printChar();
        //printArray();
        printString();
    }

    private void printString()
    {
        string[] Locations = { "Northeast", "Southeast", "Midwest", "Southwest", "West" };
        string strList = string.Empty;
        string strList2 = string.Empty;

        string[] Locations2 = { "1" };

        //  Method 1
        foreach (string str in Locations2)
            strList += str + ",";
        strList = strList.Remove(strList.Length - 1);
        Label1.Text = strList;

        //  Method 2
        int i = 0;
        foreach (string str in Locations)
        {
            strList2 += str;
            if (i < Locations.Length - 1)
                strList2 += ",";
            i++;
        }
        Label2.Text = strList2;
    }

    private void printArray()
    {
        string[] arr1 = new string[0];
        //arr[0] = "0";
        string[] arr2 = new string[2];
        arr1 = arr2;
        Label1.Text = arr1.Count().ToString();
    }

    private void printChar()
    { 
        char ch = 'A';
        Label1.Text = "ch = " + ch.ToString() + "<br>" + "Length = " + ch.ToString().Length;
    }
}
